$(function() {
    $("form[class=stepForm]").each(function() {
        var a, b, c, d, e, f, g;
        if ("true" == $(this).attr("stepFormTitle")) {
            for (a = $("<div class='titleMain'><ul></ul><div class='clear'></div></div>"), $(this).prepend(a), 
            b = $("form[class=stepForm] div[class=stepForm]"), c = $("<li class='stepFormTitle'><div class='left'></div><div class='center'></div><div class='right'></div><div class='clear'></div></li>"), 
            c.find(".center").text(b.eq(0).attr("stepFormTitle")), a.append(c), d = b.length - 1, 
            e = 0; d > e; e++) f = $("<li class='stepFormTitle'><div class='left'></div><div class='center'></div><div class='right'></div><div class='clear'></div></li>"), 
            f.find(".center").text(b.eq(e + 1).attr("stepFormTitle")), a.append(f);
            g = $("<div class='clear'></div>"), a.append(g), a.after($("<br/>"));
        }
    });
    var a;
    a = null != $("form[class=stepForm]").eq(0).attr("currentStepNum") ? Number($("form[class=stepForm]").eq(0).attr("currentStepNum")) : 0, 
    $("form[class=stepForm] div[class=stepForm]").not(":eq(" + a + ")").hide();
    try {
        $("form[class=stepForm] div[class=titleMain] li").eq(a)[0].className = "stepFormTitleCur";
    } catch (b) {}
    $("input:button").each(function() {
        var c, d, b = $(this).attr("selfTarget");
        null != $(this).attr("nextTarget") ? (c = $(this).attr("nextTarget"), $(this).click(function() {
            var d = !0;
            try {
                d = $("#" + b).validationEngine({
                    returnIsValid: !0
                });
            } catch (e) {}
            if (1 == d) {
                a++, $("#" + b).hide(), $("#" + c).show(500), $("form[class=stepForm] div[class=titleMain] li").each(function() {
                    $(this)[0].className = "stepFormTitle";
                });
                try {
                    $("form[class=stepForm] div[class=titleMain] li").eq(a)[0].className = "stepFormTitleCur";
                } catch (e) {}
            }
        })) : null != $(this).attr("prevTarget") && (d = $(this).attr("prevTarget"), $(this).click(function() {
            a--, $("#" + b).hide(), $("#" + d).fadeIn(500), $("form[class=stepForm] div[class=titleMain] li").each(function() {
                $(this)[0].className = "stepFormTitle";
            });
            try {
                $("form[class=stepForm] div[class=titleMain] li").eq(a)[0].className = "stepFormTitleCur";
            } catch (c) {}
        }));
    });
});